package com.zzxy.service.impl;

import com.zzxy.dao.impl.AccountDaoImpl;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public class AccountServiceImpl {

    private AccountDaoImpl accountDao;

    public AccountDaoImpl getAccountDao() {
        return accountDao;
    }

    public void setAccountDao(AccountDaoImpl accountDao) {
        this.accountDao = accountDao;
    }

    @Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
    public void transer(String outer, String inner, int money ){
        accountDao.out(outer,money);
        int i = 1 / 0;
        accountDao.in(inner,money);
    }
}
